home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / windows / a_tartan.zip / A_TARTAN.TXT < prev   
Text File  |  1992-01-16  |  8KB  |  206 lines

  1. a_tartan - a Microsoft Windows tartan generator
  2. Version 1.0
  3. Copyright 1992 James Patrick Russell.  All Rights Reserved.
  4.  
  5. Antrim Software Cellar
  6. Jim Russell, prop.
  7. 27 Freeman Place
  8. Nutley NJ 07110 USA
  9. CIS [71620,3061]
  10. ILink - JIM RUSSELL (WinAppDev conference host)
  11.  
  12.  
  13. Purpose:
  14.  
  15.   This WinApp will generate a small "swatch" of tartan bitmap, which can
  16. be used as tiled wallpaper in Microsoft Windows (v3.0 and later).  It
  17. was written solely for my own amusement, and I am distributing it as
  18. "freeware" for anyone to freely use and enjoy.  I ask only for feedback
  19. and maybe some pattern description's of YOUR clan's tartan.
  20.  
  21.   As this is basically a "toy" application, don't expect long-winded docs
  22. explaining what Windows wallpaper is, or for that matter, what tartans
  23. are.  If someone else knows enough to expand this little note, feel
  24. free.  Send me a copy, and it'll go into the next revision.
  25.  
  26.  
  27. What's here:
  28.  
  29.      a_tartan.exe         The program.  Goes wherever you keep WinApps.
  30.      a_tartan.ini         Sample tartan patterns from my family tree
  31.                           (Russell and Ross).  Put this in your Windows
  32.                           directory (the one that has WIN.INI in it).
  33.      a_tartan.txt         What you're reading right now.
  34.  
  35.  
  36. What's not here, but you need:
  37.  
  38.      vbrun100.dll         The Visual Basic runtime library, available
  39.                           virtually anywhere you download files.  Since
  40.                           it is expected that a large proportion of
  41.                           Windows freeware/shareware will be written
  42.                           in Visual Basic, there is an unwritten rule
  43.                           that it not be included in everybody's archives.
  44.                           Pick it up separately and save download time!
  45.  
  46.       
  47. Tartan Theory:
  48.  
  49.   This whole application came about when I wore my Russell tartan tie to
  50. work one day.  While waiting for my ILink mail transfer to download, I
  51. began examining the tie, and noticed that the cross-hatch pattern of the
  52. threads looked a lot like pixels in a bitmap.  In fact, the areas where
  53. the black threads were going horizontal and the green threads were going
  54. vertical looked exactly like a dithered color.  I also noticed that the
  55. pattern of a tartan is regularly repeating -- hmmm, just like tiled wall-
  56. paper!  If I could only describe the way it repeats, I could generate a
  57. small bitmap, and tile it, and have my Windows wallpaper be the Russell
  58. tartan.
  59.  
  60.   That's exactly what I did.  I broke down the description like so:
  61.  
  62.      1 255 255 255
  63.      15 0 0 255
  64.      2 255 0 0
  65.      15 0 0 0
  66.      15 0 128 0
  67.      1 0 0 0
  68.  
  69.   The first number of each line is the number of threads for a certain
  70. color.  The other three numbers are the red, green and blue values for
  71. that color, ranging from 0 to 255.  This is the "standard" way of
  72. describing colors in Windows.  So what we have above is:
  73.  
  74.      a.  1 white thread
  75.      b. 15 blue threads
  76.      c.  2 red threads
  77.      d. 15 black threads
  78.      e. 15 dark green threads
  79.      f.  1 black thread
  80.  
  81.   Now, this only describes part of the tartan, but the rest of it is all
  82. mirror images of this description.  In other words, in order to have a
  83. "swatch" of tartan that would tile correctly, the threads would be 
  84. "woven" like this:
  85.  
  86.        a b c d e f f e d c b a
  87.     a
  88.     b
  89.     c
  90.     d
  91.     e
  92.     f
  93.     f
  94.     e
  95.     d
  96.     c
  97.     b
  98.     a
  99.  
  100.    Now, since that time, I've examined quite a few other tartans, and it
  101. seems that they all follow this "mirror" pattern.  If there are some
  102. that are not symmetrical like this, please contact me and let me know
  103. about them.  Also, please note from the description above that the edges
  104. of the "tile" pattern were described with 1 thread, even though, when
  105. you look at the tartan, there are 2 threads.  This is, of course, because
  106. they will be butting up against another copy of the bitmap in the tile
  107. (in the case of thread "a"), or against the "mirror" (in the case of
  108. thread "f").
  109.  
  110.    Clear as mud?
  111.  
  112.    Then, I got into a discussion on the ILink network with an actual
  113. Scotsman, a Mr. Sandy Blair from Glasgow.  He brought up something I
  114. had not thought about -- the weave.  I wrote "a_tartan" assuming that
  115. all tartans were woven the way that tie was -- one thread up, one thread
  116. down, making the whole pattern look somewhat like a checkerboard.  He
  117. showed me some other weaves that were used, and they may be implemented
  118. in future versions.  For now, I stuck with the checkerboard weave.
  119.  
  120.  
  121.    A note on colors -- even though I used the RGB description for
  122. colors, which allows for 256 values for each of red, green and blue,
  123. a_tartan v1.0 only draws in 16 colors.  This is a limitation of
  124. Visual Basic, so until I port this application to Borland C++, that's
  125. what we've got to work with.  If you're not really, really picky as
  126. far as shades are concerned, you should be able to describe your
  127. tartan using the 16.  Which, by the way, are:
  128.  
  129.      255 255 255    white
  130.        0   0   0    black
  131.      255   0   0    red
  132.        0 255   0    green
  133.        0   0 255    blue
  134.      128   0   0    dark red (kind of maroon-y)
  135.        0 128   0    dark green (a forest green, useful in tartans)
  136.        0   0 128    dark blue (almost purple)
  137.      255 255   0    yellow
  138.      255   0 255    magenta
  139.        0 255 255    cyan (sky blue)
  140.      128 128   0    brown (copper/gold shade)
  141.      128   0 128    dark magenta
  142.        0 128 128    dark cyan (sky blue on a miserable day)
  143.      128 128 128    dark grey
  144.      192 192 192    light grey
  145.  
  146.  
  147. Running the program:
  148.  
  149.    If, by any chance, you've understood any of my ramblings above, and have
  150. figured out how to describe your family's tartan, the actual running of
  151. "a_tartan" is easy.  Run the program (under Windows, of course).  You'll
  152. see a superbly designed main window.  Press the "About..." button to
  153. display my name.  Ahhh, thank you.  Freeware authors live for things like
  154. that.  You can press the "Ok" button to get back to the main window any
  155. time now.
  156.  
  157.   Alright, let's take the areas of the main window one at a time:
  158.  
  159.      Clan:  The "name" of the tartan, usually the family or clan name.
  160.      This is a combo-box -- you can press the little arrow to
  161.      pick from any previously described tartans saved in the
  162.      .INI file, or type in a new name.
  163.  
  164.      Pattern:  This is where you type in a pattern consisting of lines
  165.      of four numbers (number of threads, red, green, blue) as
  166.      I tried to describe above.  Don't leave any blank lines
  167.      in between.
  168.  
  169.      Pixels per thread:  Defaults to one.  I put this in because on a
  170.      high-resolution monitor, you might want to have "bigger" threads,
  171.      of two or three pixels.  It's here, and it works, but it's pretty
  172.      slow.  If you've got WinGif, or something similar, you might want
  173.      to generate your bitmap at 1 pixel/thread, and use WinGif to 
  174.      enlarge it.
  175.  
  176.      "Generate" button:  Generates the bitmap.  Once pressed, this
  177.      changes to a "Cancel" button, which stops the drawing.  By the
  178.      way, you can minimize a_tartan while it's generating if you want.
  179.  
  180.      "Save BMP" button:  Once generated, you will want to save the
  181.      bitmap to a .BMP file, for later wallpaper use.  I was very lazy
  182.      here - I make you type in the file name, and didn't use any of the
  183.      little directory windows and stuff you're probably used to seeing
  184.      in WinApps.  Maybe when Windows v3.1 comes out, I'll use their
  185.      "common file dialog" box.
  186.  
  187.      "About" button:  Go ahead, press it again.
  188.  
  189.      Tartan drawn here:  Tartan drawn here.
  190.  
  191.  
  192. Contacting the author:
  193.  
  194.      The best way to get in touch with me is on the ILink bulletin
  195. board network -- I host the Windows Application Development conference
  196. (WinAppDev), and also lurk around in Basic, C-Lang, Programming,
  197. RockAndRoll, and a few other places.  You can also reach me on CompuServe
  198. as [71620,3061], or by writing a real letter (my address is at the top
  199. of this file).  Let me know about any bugs, anomalies, or anything else
  200. about "a_tartan".  And send me some more tartan descriptions!
  201.  
  202. Enjoy!
  203.  
  204. Jim Russell
  205. 16 Jan 1992                 
  206.